﻿<%@ Page 
    Language="C#" 
    AutoEventWireup="true" 
    CodeBehind="TreeViewXmlSource.aspx.cs" 
    Inherits="AspNetTreeView.TreeViewXmlSource" 
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>    
        <asp:TextBox runat="server" id="TextBoxNumber" />
        <asp:TreeView runat="server" ID="treeViewBookstore" 
            DataSourceID="XmlDataSourceBooks"
            AutoGenerateDataBindings="false">
            <DataBindings >
                <asp:TreeNodeBinding DataMember="bookstore" value="Bookstore Database" />
                <asp:TreeNodeBinding DataMember="genre"  TextField="name" />
                <asp:TreeNodeBinding DataMember="book" Text="ISBN" TextField="ISBN" />
                <asp:TreeNodeBinding DataMember="title" Text="title" TextField="#InnerText" />
                <asp:TreeNodeBinding DataMember="comments" Text="Comments" />
                <asp:TreeNodeBinding DataMember="userComment" TextField="#InnerText" />
                <asp:TreeNodeBinding DataMember="userComment" TextField="rating" />
            </DataBindings>
            <HoverNodeStyle BackColor="Azure" ForeColor="Wheat" />
        </asp:TreeView>
        <asp:XmlDataSource ID="XmlDataSourceBooks" runat="server" 
            DataFile="~/XmlFiles/Books.xml">
        </asp:XmlDataSource>
    </div>
    </form>
</body>
</html>
